package com.zl.Test3;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

import javax.sql.DataSource;


//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(locations = "classpath:spring-dao.xml")
//@TransactionConfiguration(transactionManager = "txManager", defaultRollback = false)
//@Transactional(timeout = 2)
//public class TimeoutTest {
//    @Autowired
//    private DataSource ds;
//    @Test
//    public void testTimeout() throws InterruptedException {
//        System.out.println(System.currentTimeMillis());
//        JdbcTemplate jdbcTemplate = new JdbcTemplate(ds);
//        jdbcTemplate.execute(" update test set name = name || '1'");
//        System.out.println(System.currentTimeMillis());
//        Thread.sleep(3000L);
//    }
//}
